1. The Field of the Invention
This invention relates generally to computer graphics and systems for generating computer graphics on a display device. More specifically, the present invention relates to generating anti-aliased textured and layered fog in a geocentric environment to thereby render a more accurate image of the fog or similar phenomena in conjunction with the earth when viewing-an image which is representative of flight at any altitude, but particularly at high altitudes.
2. The State of the Art
The state of the art in rendering fog has been primarily dictated by the restraints of the coordinate system in which terrain environments are rendered. More specifically, the earth is typically rendered in a virtual environment using a flat or Cartesian coordinate system because the curved nature of the earth is typically not noticeable at the scale at which most three dimensional virtual environments are rendered. However, an important exception is the case presented by flight simulation.
The benefits of training pilots by using flight simulators are numerous. However, training is less effective when the pilots are unable to use the same visual clues that are normally present for them in the real world. Accordingly, the desire to provide realistic three dimensional virtual environments has very practical applications, only one of which is described above.
The state of the art in three-dimensional rendering of a virtual flight environment has attempted to realistically render fog, where the term fog includes clouds of varying degrees of opacity. The most common fogging function available today in an image generator (IG) and a graphic accelerator is generally referred to as homogeneous fog. Homogeneous fog derives its name from the fact that fog density is uniform in every direction from an eye position throughout the virtual environment. The density of the fog between an object and the eye position is only a function of the range between them.
FIG. 1 of the prior art shows that layered fog (also called real fog) is a non-homogenous approach to generating the fogging function. The layered fog algorithm provides the ability to define different densities for each layer or altitude in the atmosphere. In this figure, three separate layers 10, 12 and 14 of fog are shown between an eye position 16 and an object 18 being observed. The visibility between the eye position 16 and the object 18 is not only a function of the range between them, but also the layers through which an eye vector (from the eye position 16 to the object 18) passes.
For every pixel that is to be rendered, an eye vector from the eye position 16 to a pixel must be generated. The fog contribution to the pixel must be calculated for each layer through which the eye vector passes on its path to the pixel, and all of these contributions must be blended into a final result.
One important visual clue to a pilot of the present altitude is that the horizon of the earth starts to depress a few degrees at high altitudes, due to the curvature of the earth. As stated previously, the rendering for nearly all IGs and graphic accelerators are in a Cartesian frame of reference, not spherical. To address the need for the correct display of a geocentric environment, polygons that are being processed (scaled, translated and rotated) in a Cartesian frame of reference have their altitudes (usually on the Z axis) depressed as a function of the curvature of the planet and the range from the eye position. This scenario generates believable rendering as long as there is no layered fog applied.
The state of the art in layered fog took advantage of the Cartesian environment by defining the layers along the Z axis of the environment. However, mixing previous layered fog implementations and a geocentric environment are not possible due to the layered fogs' dependency on a “flat earth” or Cartesian frame of reference.
Accordingly, what is needed is a way to provide accurate visual altitude clues in a three dimensional and geocentric virtual environment with layered fog.
In conjunction with a lack of altitude clues, the state of the art also suffers from a lack of velocity clues. State of the art layered fog does little to provide visual cues for horizontal movement of the eye position or other objects in the virtual environment.
Accordingly, what is also needed is a way to provide accurate visual velocity clues in a three dimensional and geocentric virtual environment with layered fog.
Another fundamental problem that has plagued the state of the art layered fog systems is the aliasing that occurs between the pixels of a polygon that straddles the boundary between two or more fog layers which have significantly different fog layer densities. The result is that the center of a pixel will be determined to be within a layer with a high fog density while the center of the adjacent pixel will be determined to be within the next layer with a low fog density. The two resulting pixels will have significantly different pixel colors, and thus aliasing will occur. In other words, a jagged step ladder will be formed along the boundary between different fog layers, instead of a smooth or smudged appearance between them. The problem grows more pronounced as the pixels being rendered are at a great distance from the eye position (such as on the horizon), and when the pixels represent a significantly larger physical area. This occurs when a pixel becomes larger than the thickness of the fog layer.
Accordingly, what is also needed is a way to provide anti-aliasing in a three dimensional and geocentric virtual environment having layered fog.
It is useful to understand the shortcomings of the state of the art by looking at several patents which introduce important concepts, but fail to satisfy the issues above.
In U.S. Pat. No. 5,412,796, the patent issued to Olive teaches the concept of non-homogeneous fog. It is also noted that it is assumed that all fog layers are parallel in a Cartesian coordinate environment, thus failing to provide valuable altitude clues, among other things.
In U.S. Pat. No. 5,724,561, the patent issued to Tarolli et al. apparently teaches the concept of using blending to soften the boundaries between fog layers. Three registers are provided for storing color pixel data, a depth perspective component, and fog color data. This information is then blended using a blending unit and output by the system. This system differs substantially from the method and apparatus of the present invention as will be shown.